﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>增加患者</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <!--link-->
    <link type="text/css" rel="stylesheet" href="../../../Resource/css/style.css" />
    <link type="text/css" rel="stylesheet" href="../../../Resource/css/add_doctor.css" />
    <!--js-->
    <script src="../../../Resource/js/jquery.min.js"></script>
    <script src="../../../Resource/js/add_doctor.js"></script>
    <style>
        .discoloration {
            color: #ed7e17;
        }
        body{
            overflow: hidden;
        }

    </style>
    <script src="../../../../static/Resource/layer/layer.min.js"></script>
    <link rel="stylesheet" href="../../../../static/Resource/layer/skin/layer.css">
    <script src="../../../../static/Resource/layui/layui.js"></script>
    <script src="../../../../static/Resource/layui/layui.all.js"></script>
    <link rel="stylesheet" href="../../../../static/Resource/layui/css/layui.css">
</head>
<body>
<div class="container">
    <div class="main">
            <div class="form_content_top">
                <input type="hidden" id="hid_doc" value="">
                <span style="font-size:20px;color:#444444;font-weight:600;margin-left:10%;font-weight:500;">增加医生</span>
            </div>
            <div class="form_content_in">
                <ul>
                    <li>
                        <div>
                            <span style="width:13%;">姓名:</span>
                            <input style="width:85%;" id="doc_name" />
                        </div>
                    </li>
                    <li>
                        <div>
                            <span style="width:13%;">科室:</span>
                            <input style="width:85%;" id="doc_department" />
                        </div>
                    </li>
                    <li>
                        <div>
                            <span style="width:13%;">联系电话:</span>
                            <input style="width:85%;" id="doc_phone" />
                        </div>
                    </li>
                    <li>
                        <div>
                            <span style="width:13%;">身份证号:</span>
                            <input style="width:85%;" id="doc_card" />
                        </div>
                    </li>
                    <li>
                        <div style="width:49%!important;">
                            <span>年龄:</span>
                            <select style="width:40%;" id="doc_age">
                                <option>1</option>
                                <option>2</option>
                            </select>
                        </div>
                        <div style="width:49%!important;text-align:right;">
                            <span>性别:</span>
                            <select style="width:40%;" id="doc_sex">
                                <option>1</option>
                                <option>2</option>
                            </select>
                        </div>
                    </li>
                    <li style="height:100px!important;">
                        <div style="height:100px;">
                            <span>地址:</span>
                            <textarea class="text" id="doc_address"></textarea>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="form_content_bottom">
                <button class="confirm">确认</button>
                <br />
                <button class="cancel">取消</button>
            </div>
    </div>
</div>
</body>
</html>
<link href="/static/Resource/layui/css/layui.css" rel="stylesheet" media="all" />
<script src="/static/Resource/layui/layui.js"></script>
<script>
    $(function(){



        $(".confirm").click(function(){
            let data={
                id:$("#hid_doc").val(),
                name:$("#doc_name").val(),
                department:$("#doc_department").val(),
                phone:$("#doc_phone").val(),
                card:$("#doc_card").val(),
                age:$("#doc_age").val(),
                sex:$("#doc_sex").val(),
                address:$("#doc_address").text()
            };
            if (data.name==""){
                alert("请输入医生姓名")
                return;
            }
            $.ajax({
                url:"/Doctor/Edit2",
                data: JSON.stringify(data),
                contentType : "application/json;charsetset=UTF-8",//必须
                type:"POST",
                datatype: "json",
                success :function (data){
                    if(data.IsOk)
                    {
                        layer.msg(data.message);
                        setTimeout(function () {
                            parent.window.location.reload();
                        }, 1000)
                    }
                    else{
                        layer.msg(data.message);
                    }

                }
            })
        })

    })
</script>